package com.syher.seconds.kill.kafka.starter;

import com.syher.seconds.kill.kafka.core.SpringBeanFactory;
import com.syher.seconds.kill.kafka.core.kafka.ConsumerGroup;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;

@EnableAutoConfiguration
@ComponentScan(basePackages = {
        "com.syher.seconds.kill.kafka.core"
})
public class SecondsKillKafkaStarter implements CommandLineRunner {

    public static void main(String[] args) {
        SpringApplication.run(SecondsKillKafkaStarter.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        ConsumerGroup consumerGroup = SpringBeanFactory.getBean(ConsumerGroup.class);
        consumerGroup.execute();
    }
}
